1. Field of the Invention
The present invention relates to the field of messaging and more particularly to message queue management in a messaging system.
2. Description of the Related Art
In the field of information technology, messaging refers to the exchange of information between two computing processes. A message can be something as simple as just a few bits of data, or something as robust as an electronic mail message containing embedded multimedia imagery. In its simplest form, a messaging system acts to directly exchange messages between messaging partners. Inter-process communications methods facilitate message passing between processes in a computer communications network. E-mail messaging systems rely upon messaging servers both to transmit and receive messages onto a network, and instant messaging systems moderate and facilitate the exchange of instantaneous messages between chat partners.
Message queues provide an asynchronous mode of message passing between processes. In a message queuing system, applications can submit messages to a queue for delivery to subscribing clients who can consume the messages in the queue at a later time. To the extent that a uniform message structure can be agreed upon between message provider and message consumer, a message queue can provide an ideal solution for disparate applications seeking to communicate without requiring internal codification for compatibility with one another.
In messaging systems incorporating message queues, if more messages are placed into the queue by message providing applications than are retrieved from the queue by message consumers, over a prolonged period of time a number of problems are likely to occur. First, the unintended storage of the messages in the queue necessarily will require additional storage resources and, in particular, memory buffers will fill to capacity. Once the memory buffers have become are full, a step change can occur—messages take a long time to retrieve from disk and the problems compound. If, for some reason, a temporary deluge of messages occurs the deluge can cause this “step change” meaning that the system suddenly can not keep pace with its usual workload and, in order for the system to recover, messages have to be temporarily restricted from being put into the system.
Traditionally, messaging systems employ “pacing” to ameliorate the problem. In message pacing, a feature is provided in which if messages are observed to have been queued at a faster than desired rate, a short delay is added to the enqueueing of the messages. From an applications point of view pacing is effectively invisible and can help in many circumstances. Yet, pacing is not a universal panacea—if the same applications are retrieving messages as putting them then delaying the enqueuing of messages in a message queue also delays the dequeueing of messages from the queue and achieves no net progress in reducing the message queue size. However, the added delays act to reduce throughput over all.